From dd58d2339030bd9222fb4b01faf883545102f58c Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 30 Mar 2005 17:37:42 +0000 Subject: [PATCH] Don't accept n_targets == -1. (clipboard_unset): unref the old_data, not 2005-03-30 Matthias Clasen * gtk/gtkclipboard.c (gtk_clipboard_set_can_store): Don't accept n_targets == -1. (clipboard_unset): unref the old_data, not the user_data which we have just cleared. (#172038, Sven Neumann) --- ChangeLog | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ gtk/gtkclipboard.c | 3 ++- 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 28e86a6267..59a7fd004f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2005-03-30 Matthias Clasen + * gtk/gtkclipboard.c (gtk_clipboard_set_can_store): + Don't accept n_targets == -1. + (clipboard_unset): unref the old_data, not the + user_data which we have just cleared. (#172038, Sven + Neumann) + * gtk/gtkcombobox.c (gtk_combo_box_popup): Don't segfault if somebody tries to popup an unrealized combo box. (#172031, Felipe Heidrich) diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 28e86a6267..59a7fd004f 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,11 @@ 2005-03-30 Matthias Clasen + * gtk/gtkclipboard.c (gtk_clipboard_set_can_store): + Don't accept n_targets == -1. + (clipboard_unset): unref the old_data, not the + user_data which we have just cleared. (#172038, Sven + Neumann) + * gtk/gtkcombobox.c (gtk_combo_box_popup): Don't segfault if somebody tries to popup an unrealized combo box. (#172031, Felipe Heidrich) diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 28e86a6267..59a7fd004f 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,5 +1,11 @@ 2005-03-30 Matthias Clasen + * gtk/gtkclipboard.c (gtk_clipboard_set_can_store): + Don't accept n_targets == -1. + (clipboard_unset): unref the old_data, not the + user_data which we have just cleared. (#172038, Sven + Neumann) + * gtk/gtkcombobox.c (gtk_combo_box_popup): Don't segfault if somebody tries to popup an unrealized combo box. (#172031, Felipe Heidrich) diff --git a/gtk/gtkclipboard.c b/gtk/gtkclipboard.c index bb21b009c7..dde348e1cd 100644 --- a/gtk/gtkclipboard.c +++ b/gtk/gtkclipboard.c @@ -678,7 +678,7 @@ clipboard_unset (GtkClipboard *clipboard) */ if (old_have_owner && old_n_storable_targets != -1) - g_object_unref (clipboard->user_data); + g_object_unref (old_data); } /** @@ -1609,6 +1609,7 @@ gtk_clipboard_set_can_store (GtkClipboard *clipboard, }; g_return_if_fail (GTK_IS_CLIPBOARD (clipboard)); + g_return_if_fail (n_targets >= 0); if (clipboard->selection != GDK_SELECTION_CLIPBOARD) return; -- 2.30.2